<template>
	<view>
		<view class="tab_box">
			<view class="searchBox">
				<view class="l">
					<view class="act">推荐</view>
					<view class="">同城</view>
					<view class="">关注</view>
				</view>
				<view class="search">
					<view class="input">
						<input type="text" placeholder="搜索话题">
						<u-icon name="search" color="#1C274C" size="28"></u-icon>
					</view>
				</view>
			</view>
			<view class="huati">
				<view class="items" v-if="show">
					<view class="item">
						<image src="/static/pages_find/all_icon.png" mode=""></image>
						<text>全部话题</text>
					</view>
					<view class="item">
						<image src="/static/pages_find/jing.png" mode=""></image>
						<text>你最喜欢的乐队是哪个</text>
					</view>
					<view class="item">
						<image src="/static/pages_find/jing.png" mode=""></image>
						<text>打卡浪漫约会地</text>
					</view>
				</view>
				<image @click="show = !show" :class="{act:!show}" class="topImg" src="/static/pages_find/top.png" mode=""></image>
			</view>
		</view>
		<view class="main">
			<view class="item" v-for="(i,idx) in list" :key="idx" @click="itemClick(i)">
				<image class="img" :src="i.img" mode=""></image>
				<text class="text">{{i.text}}</text>
				<view class="bot_box">
					<view class="l">
						<image :src="i.img" mode=""></image>
						<text>{{i.name}}</text>
					</view>
					<view class="r">
						<image src="../../static/pages_find/dingwei.png" mode=""></image>
						<text>{{i.km}}km</text>
					</view>
				</view>
				<view class="video_box" v-if="i.type=='video'">.
					<image src="../../static/pages_find/bofang.png" mode=""></image>
					<text>00:12</text>
				</view>
			</view>
			<u-empty mode="list" v-if="finish && list.length === 0" style="margin-top: 200rpx;" icon="/static/none.png">
					</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				finish:true,
				show:true,
				list:[
					{
						name:'王橘络',
						text:'早上好呀，早安！',
						km:'1323',
						img:'/static/pages_find/img1.png',
						type:'img'
					},
					{
						name:'王橘络',
						text:'早上好呀，早安！',
						km:'1323',
						img:'/static/pages_find/img2.png',
						type:'video'
					},
					{
						name:'王橘络',
						text:'早上好呀，早安！',
						km:'1323',
						img:'/static/pages_find/img2.png',
						type:'video'
					},
					{
						name:'王橘络',
						text:'早上好呀，早安！',
						km:'1323',
						img:'/static/pages_find/img1.png',
						type:'img'
					},
					{
						name:'王橘络',
						text:'早上好呀，早安！',
						km:'1323',
						img:'/static/pages_find/img1.png',
						type:'img'
					},
				]
			}
		},
		methods: {
			itemClick(i){
				if(i.type=='img'){
					uni.navigateTo({
						url:"/pages_find/dynamicDetails/dynamicDetails"
					})
				}else{
					uni.navigateTo({
						url:"/pages_find/videoDetails/videoDetails"
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
page{
	background: #F7F7FA;
	padding-bottom: 30rpx;
}
.tab_box{
	width: 750rpx;
	background: #FFFFFF;
	border-radius: 0rpx 0rpx 30rpx 30rpx;
	overflow: hidden;
	.searchBox{
		box-sizing: border-box;
		padding: 0 32rpx 30rpx;
		width: 750rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 110rpx;
		border-bottom: 1rpx solid #F2F2F2;
		.l{
			width: 280rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 32rpx;
			color: #959AAC;
			font-weight: bold;
			.act{
				font-size: 40rpx;
				color: #1C274C;
				background: url(/static/index/titleBg.png) no-repeat;
				background-size: 60rpx 18rpx;
				background-position: left bottom;
			}
		}
		
		.search{
			width: 336rpx;
			height: 83rpx;
			border-radius: 42rpx;
			border: 3rpx solid #1C274C;
			display: flex;
			align-items: center;
			box-sizing: border-box;
			padding: 0 32rpx;
			background-color: #fff;
			.input{
				width: 500rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.input-placeholder{
					font-size: 24rpx;
				}
			}
		}	
	}
	.huati{
		position: relative;
		min-height: 100rpx;
		.items{
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			padding: 0 32rpx 32rpx;
			box-sizing: border-box;
			.item{
				display: flex;
				align-items: center;
				padding: 15rpx 25rpx;
				background: #F7F7FA;
				border-radius: 20rpx;
				margin-right: 40rpx;
				margin-top: 30rpx;
				image{
					width: 28rpx;
					height: 28rpx;
					margin-right: 10rpx;
					font-size: 26rpx;
					font-weight: 600;
					color: #1C274C;
				}
			}
		}
		.topImg{
			width: 40rpx;
			height: 40rpx;
			position: absolute;
			right: 32rpx;
			bottom: 40rpx;
		}
		.act{
			transform: rotate(-180deg);
		}
	}
}
.main{
	box-sizing: border-box;
	padding: 0 32rpx 32rpx;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	.item{
		width: 333rpx;
		height: 449rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin-top: 30rpx;
		position: relative;
		.img{
			width: 333rpx;
			height: 303rpx;
			border-radius: 20rpx;
		}
		.text{
			font-size: 26rpx;
			font-weight: 500;
			color: #1C274C;
			line-height: 60rpx;
			padding: 0 27rpx;
			box-sizing: border-box;
		}
		.bot_box{
			margin-top: 10rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 27rpx;
			box-sizing: border-box;
			.l{
				display: flex;
				align-items: center;
				font-size: 24rpx;
				color: #1C274C;
				image{
					width: 38rpx;
					height: 38rpx;
					border-radius: 50%;
					margin-right: 10rpx;
				}
			}
			.r{
				display: flex;
				align-items: center;
				font-size: 24rpx;
				color: #8D93A5;
				image{
					width: 20rpx;
					height: 24rpx;
					margin-right: 5rpx;
				}
			}
		}
		.video_box{
			font-size: 26rpx;
			color: #FFFFFF;
			display: flex;
			align-items: center;
			position: absolute;
			top: 260rpx;
			left: 20rpx;
			image{
				width: 28rpx;
				height: 28rpx;
				margin-right: 12rpx;
			}
		}
	}
}
</style>
